package com.gome.han.lucene.analyzer.CoreAnalysis;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;

/**
* @author hanpeng
* @version 创建时间：2021年2月5日 下午1:43:46
* @ClassName 类名称
* @Description 类描述: org.apache.lucene.analysis 包提供
*              Analyzer负责提供TokenStream(多个token),给indexing或者searching 进程(process)使用。
*              为了定义analysis做什么,Analyzer必须定义TokenStreamComponents,也就是实现
*              protected TokenStreamComponents createComponents(String fieldName) 这个方法。
*              components  在每次调用 tokenStream(String, Reader)地时候会被重用
*/
public class _001Analyzer {

	public static void main(String[] args) {
		 
	}

}
class  HanFirstAnalyzer extends Analyzer {

	@Override
	protected TokenStreamComponents createComponents(String fieldName) {
		/*Tokenizer source = new FooTokenizer(reader);
		TokenStream filter = new FooFilter(source);
		filter = new BarFilter(filter);
		return new TokenStreamComponents(source, filter);*/
		return  null;
	}

	/*protected TokenStream normalize(TokenStream in) {
		// Assuming FooFilter is about normalization and BarFilter is about
		// stemming, only FooFilter should be applied
		return new FooFilter(in);
		return null;
	}
	*/
	
}
